package com.gpStudy.Netty.IO.BIO.tomcat_netty.http;

public abstract class GPServlet {

    public void service(GPRequest request, GPResponse response) throws Exception{

        if ("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(request, response);
        }else if ("POST".equalsIgnoreCase(request.getMethod())) {
            doPost(request, response);
        }else{
            System.err.println("Unknown request type!!!");
        }
        
    }

    protected abstract void doPost(GPRequest request, GPResponse response) throws Exception;

    protected abstract void doGet(GPRequest request, GPResponse response) throws Exception;


}
